Skip to content

Fix malformed SupportedOSPlatform attribute from wrapped csproj lines (release/4.1) - #1781

Merged
borrrden merged 1 commit into
release/4.1from
fix/supported-os-platform-linebreak-4.1
Jul 28, 2026
Merged

borrrden merged 1 commit into
release/4.1from
fix/supported-os-platform-linebreak-4.1

Conversation

@borrrden

Copy link
Copy Markdown
Member

Summary

Backport of #1780 to release/4.1.

  • SupportedOSPlatformVersion/TargetPlatformMinVersion in Couchbase.Lite.csproj were line-wrapped (tag+Condition on one line, value on the next). MSBuild does not trim that leading newline/indentation from the property value.
  • That whitespace gets concatenated verbatim by the SDK's GenerateAssemblyInfo target into the compiled [assembly: SupportedOSPlatform(...)] attribute — e.g. "Android\r\n 24.0" instead of "android24.0".
  • Roslyn's (and Rider's) platform-compat analyzer can't parse a version out of that mangled string, so every consumer calling Couchbase.Lite APIs sees spurious CA1416 warnings, even when their own SupportedOSPlatformVersion matches exactly.
  • Fix: collapse each property back to a single line. Added a comment to prevent regression.

Test plan

  • Build net10.0-android target, decompile the resulting Couchbase.Lite.dll, confirm the SupportedOSPlatform attribute string has no embedded whitespace
  • Confirm downstream consumer project no longer emits CA1416 for Couchbase.Lite API calls

🤖 Generated with Claude Code

Backport of the fix on master: line-wrapping SupportedOSPlatformVersion/
TargetPlatformMinVersion split the tag from its value, and MSBuild
preserved the leading newline+indent verbatim. That whitespace got baked
into the compiled [assembly: SupportedOSPlatform(...)] attribute (e.g.
"Android\r\n      24.0" instead of "android24.0"), which breaks Roslyn's/
Rider's platform-compat version parsing and causes spurious CA1416
warnings for every consumer calling into Couchbase.Lite, even when their
own min-version matches.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

This is a release branch and commits are restricted.

Please confirm this PR is one of the following:

  • A response to a customer ask
  • A change per our security policy
  • A non-functional change (e.g. changes needed for building an older version)
  • A bug fix for a x.y.0 release
  • A change that has been granted an exception (please comment)

@borrrden
borrrden requested a review from pasin July 27, 2026 21:18
@borrrden
borrrden merged commit 54af081 into release/4.1 Jul 28, 2026
2 checks passed
@borrrden
borrrden deleted the fix/supported-os-platform-linebreak-4.1 branch July 28, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants